package com.adou.d8.thread.comm;

public class ThreadTest {
    public static void main(String[] args) {
        Desk desk = new Desk();


        // 厨师
        new Thread(()->{
            while(true){
                desk.out();
            }
        },"厨师1").start();

        new Thread(()->{
            while(true){
                desk.out();
            }
        },"厨师2").start();

        new Thread(()->{
            while(true){
                desk.out();
            }
        }, "厨师3").start();

        // 吃货
        new Thread(()->{
            while(true){
                desk.in();
            }
        }, "吃货1").start();

        new Thread(()->{
            while(true){
                desk.in();
            }
        }, "吃货2").start();
    }

}
